/*
 * XProgressEvent.java, created on Oct 28, 2005
 * 
 * Copyright (c) 2005 - 2007
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.xfc.eventbus;

import java.util.EventObject;

/**
 *
 *
 * @author Devon Carew
 */
public class XProgressEvent
	extends EventObject
{
	/** Start of indeterminate progress */
	public static final int INDETERMINATE_START 	= 0;
	
	/** End of indeterminate progress */
	public static final int INDETERMINATE_END 		= 1;
	
	
	/** Start of determinate progress */
	public static final int DETERMINATE_START 		= 2;
	
	/** A determinate progress event - the property percentageComplete has amount of work completed so far */
	public static final int DETERMINATE_PROGRESS	= 3;
	
	/** End of determinate progress */
	public static final int DETERMINATE_END 		= 4;
	
	private int eventType;
	private int percentageComplete;
	
	/**
	 * @param source
	 * @param eventType
	 */
	public XProgressEvent(Object source, int eventType)
	{
		super(source);
		
		this.eventType = eventType;
	}
	
	/**
	 * @param source
	 * @param eventType
	 * @param percentageComplete
	 */
	public XProgressEvent(Object source, int eventType, int percentageComplete)
	{
		super(source);
		
		this.eventType = eventType;
		this.percentageComplete = percentageComplete;
	}
	
	/**
	 * @return Returns the eventType.
	 */
	public int getEventType()
	{
		return eventType;
	}
	
	/**
	 * @return Returns the percentage complete.
	 */
	public int getPercentageComplete()
	{
		return percentageComplete;
	}
}
